/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.matezk.dms.things.model.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import top.continew.starter.extension.crud.model.req.BaseReq;

import java.io.Serial;

/**
 * 创建或修改固件包
 *
 * @author 程道林
 * @since 2025/09/25 20:24
 */
@Data
@Schema(description = "创建或修改固件包")
public class FotaPkgReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 设备ID
     */
    @Schema(description = "固件名称")
    @NotBlank(message = "固件名称不能为空")
    @Length(max = 30, message = "固件名称长度不能超过 {max} 个字符")
    private String pkgName;

    /**
     * 产品ID
     */
    @Schema(description = "产品ID")
    @NotBlank(message = "产品ID不能为空")
    @Length(max = 16, message = "产品ID长度不能超过 {max} 个字符")
    private String productId;

    /**
     * 固件包类型
     */
    @Schema(description = "固件包类型")
    @NotBlank(message = "固件包类型不能为空")
    private String pkgType;

    /**
     * 老版本
     */
    @Schema(description = "老版本")
    private String oldVersion;

    /**
     * 新版本
     */
    @Schema(description = "新版本")
    private String newVersion;

    /**
     * 固件包描述
     */
    @Schema(description = "固件描述")
    private String pkgDesc;

    /**
     * 固件包下载地址
     */
    @Schema(description = "固件下载地址")
    @NotBlank(message = "固件下载地址不能为空")
    @Length(max = 128, message = "固件下载地址不能超过 {max} 个字符")
    private String pkgUrl;
}